﻿// See https://aka.ms/new-console-template for more information

using System.Runtime.InteropServices.ComTypes;
using Neo4j.Driver;

Console.WriteLine("Hello, World!");

var driver = GraphDatabase.Driver("neo4j://localhost:17687",
    AuthTokens.Basic("neo4j", "Pass@word"));

var session =
    driver.AsyncSession(p => p.WithDefaultAccessMode(AccessMode.Write));

session.ReadTransactionAsync(async p => {
    var result =
        await p.RunAsync(
            "MATCH (a)-[:KNOWS]->(b) RETURN a.name, b.name");

    await result.FetchAsync();
    Console.WriteLine(result.Current["a.name"]);
    Console.WriteLine("KNOWS");
    Console.WriteLine(result.Current["b.name"]);
}).Wait();